<div id="user_form" class="profile_password">
    <form id="resetpassword" action="<!--{iCMS:router url='/user'}-->" method="post" target="iCMS_FRAME">
      <input name="action" type="hidden" value="profile" />
      <input name="pg" type="hidden" value="setpassword" />
      <div class="title"> <span>修改密码</span> </div>
      <dl>
        <dt>现在的密码：</dt>
        <dd>
          <input name="oldPwd" class="gray_text r5" type="password" value="">
        </dd>
        <dt>新的密码：</dt>
        <dd>
          <input id="password" name="newPwd1" class="gray_text r5" type="password" data-errormsg="密码长度应为6~16个字符">
          <span class="tip" style="">密码长度应为6~16个字符</span>
          <div class="level" style="display:none">
            <div class="l01 li"><span class="ls current">弱</span></div>
            <div class="l02 li"><span class="ls">中</span></div>
            <div class="l03 li"><span class="ls">强</span></div>
          </div>
        </dd>
        <dt>确认新的密码：</dt>
        <dd>
          <input name="newPwd2" class="gray_text r5" type="password" value="">
        </dd>
        <dt>验证码：</dt>
        <dd>
            <input id="iCMS-reg-seccode" type="text" maxlength="4" name="seccode" class="iCMS_seccode">
            <img src="<!--{iCMS:router url='/api/public/seccode'}-->" alt="验证码" class="iCMS_seccode_img r3"/>
            <a href="javascript:;" class="iCMS_seccode_text" style="float: none">换一张</a>
        </dd>
        <div class="clearfix mt20"></div>
        <dd class="pl40">
          <input class="btn btn-primary btn-large" type="submit" value="确认修改">
          <input class="btn" type="reset" value="取消">
        </dd>
      </dl>
    </form>
    <!-- 修改部分结束 -->
  </div>
  <script type="text/javascript">
$(function(){
	$("#resetpassword").submit(function(){
		var oldPwd= $("[name='oldPwd']");
		if(oldPwd.val()==""){
      oldPwd.focus();
			iCMS.alert("请填写原密码！");
			return false;
		}
		var password= $("#password").val();
		if(password==""){
      $("#password").focus();
			iCMS.alert("请填写新密码！");
			return false;
		}
		if(password.length<6){
      $("#password").focus();
			iCMS.alert("新密码太短啦，至少要6位哦");
			return false;
		}
		var newPwd2= $("[name='newPwd2']");
		if(newPwd2.val()==""){
      newPwd2.focus();
			iCMS.alert("请确认新的密码！");
			return false;
		}
		if(password!=newPwd2.val()){
      $("#password").focus();
			iCMS.alert("新的密码与确认密码不一致！");
			return false;
		}
		var seccode= $("[name='seccode']");
		if(seccode.val()==""){
      seccode.focus();
			iCMS.alert("请输入验证码！");
			return false;
		}
	})
})
</script>

